package bonusstrategy;

import name.fowler.refactoring.simplestore.Customer;
import name.fowler.refactoring.simplestore.PriceCodes;
import name.fowler.refactoring.simplestore.Rental;

public class SimpleBonusCountStrategy implements IBonusRecountStrategy{

	@Override
	public int calculateBonus(Rental rental, Customer customer) {
		boolean isNewRelease = rental.getMovie().getPriceCode() == PriceCodes.NEW_RELEASE;
		if (isNewRelease && (rental.getDaysRented() > 1)) {
			return 2;
		} else {
			return 1;
		}
	}

}
